/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MyBean;

import MyClass.Category;
import MyClass.DBConnector;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author God
 */
public class CategoryList {

    static ResultSet list;
    static Category latest;

    public static ResultSet getList() {
        try {
            Connection con = DBConnector.getConnection();
            Statement selectSt = con.createStatement();
            list = selectSt.executeQuery("SELECT * FROM Product,Category Where Product.catID=Category.catID");
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(ProductList.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(ProductList.class.getName()).log(Level.SEVERE, null, ex);
        }
        return list;
    }
}
